[Android] Send Native Crash reports with empty stacktraces for OS 11#934
[Android] Send Native Crash reports with empty stacktraces for OS 11#934
Conversation
There was a problem hiding this comment.
Pull request overview
Adds support for generating “skeleton” native-crash reports on Android API 30 when ApplicationExitInfo.getTraceInputStream() returns null, avoiding silently dropping those crashes.
Changes:
- Make
processAppExitReport(..., traceInputStream)nullable throughIIssueReporterProcessor/IssueReporterProcessor. - Update
IssueReporterto always invoke.use {}on the (nullable) trace stream and forward it to the processor. - Add
NativeCrashProcessorfallback to build a minimal native-crashReportwhen tombstone data is unavailable, plus a regression test and changelog entry.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/IssueReporter.kt | Routes app-exit processing through a single .use {} path that can forward a null stream. |
| platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/processor/IIssueReporterProcessor.kt | Updates API contract to accept a nullable trace stream (defaulting to null). |
| platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/processor/IssueReporterProcessor.kt | Propagates nullable stream into native crash processing and ANR processing path. |
| platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/processor/NativeCrashProcessor.kt | Generates a skeleton native crash report when tombstone stream is null. |
| platform/jvm/capture/src/test/kotlin/io/bitdrift/capture/reports/processor/IssueReporterProcessorTest.kt | Adds test coverage for the new skeleton-report behavior. |
| CHANGELOG.md | Documents the API-30 native-crash reporting fix. |
Comments suppressed due to low confidence (1)
platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/processor/IssueReporterProcessor.kt:117
traceInputStreamis now nullable, but the ANR branch passes it directly toprocessAndPersistANR(stream: InputStream, ...), which requires a non-null stream. This is a compile-time type mismatch (and would also be a runtime issue if forced). Consider requiring a non-null stream whenfatalIssueType == ReportType.AppNotResponding(e.g.,val stream = requireNotNull(traceInputStream)with a clear error/log + early return) while keeping null allowed for native crashes.
traceInputStream: InputStream?,
) {
runCatching {
if (fatalIssueType == ReportType.AppNotResponding) {
streamingReportsProcessor.processAndPersistANR(
traceInputStream,
timestamp,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
...jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/processor/IIssueReporterProcessor.kt
Outdated
Show resolved
Hide resolved
...rm/jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/processor/NativeCrashProcessor.kt
Outdated
Show resolved
Hide resolved
...rm/jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/processor/NativeCrashProcessor.kt
Outdated
Show resolved
Hide resolved
Size Comparison Report (x86_64)
|
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
...rm/jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/processor/NativeCrashProcessor.kt
Show resolved
Hide resolved
.../jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/processor/IssueReporterProcessor.kt
Outdated
Show resolved
Hide resolved
|
@copilot apply changes based on the comments in this thread |
Removed the Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/processor/NativeCrashProcessor.kt:206
descriptionis nullable, butsignalName.ifEmpty { description }requires a non-null fallback string. As written, this won’t compile (or would risk passing null intocreateString). Use a non-null default (e.g.,description ?: "Native crash") for the empty-signal case so the error name/reason is always a valid string.
tombstone: Tombstone,
frameOffsets: IntArray,
): Int {
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.../capture/src/test/kotlin/io/bitdrift/capture/reports/processor/IssueReporterProcessorTest.kt
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
.../jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/processor/IssueReporterProcessor.kt
Outdated
Show resolved
Hide resolved
platform/jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/IssueReporter.kt
Outdated
Show resolved
Hide resolved
...rm/jvm/capture/src/main/kotlin/io/bitdrift/capture/reports/processor/NativeCrashProcessor.kt
Show resolved
Hide resolved
Android Benchmark Results
Allocations
Timing
|
|
@copilot apply changes based on the comments in this thread |
Applied all changes from that review thread in 217848b:
|
|
@copilot after your changes the build broke with the following error, go fix it: |
Removed Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-Authored-By: murki <216735+murki@users.noreply.github.com>
b1075f5 to
90742b7
Compare
2644123 to
6686aa2
Compare
6686aa2 to
5bb89e5
Compare
What
Resolves BIT-7817
Adds support for generating native-crash reports on Android API 30 without stacktraces when
ApplicationExitInfo.getTraceInputStream()returnsnull, avoiding silently dropping those crashes.Will rely on status from AppExit which is set here
Verification
With OS 11 emulator trigger random native crash on gradle-test-app
Trigger same crash
NATIVE_CAPTURE_DESTROY_CRASHon both OS levelsCHANGELOG.md's "Unreleased" section has been updated, if applicable.